<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">

    <title>管理员登入</title>

    <!-- Bootstrap core CSS -->
    <link href="/css/bootstrap.min.css" rel="stylesheet">
    <style>
        body {
            padding-top: 40px;
            padding-bottom: 40px;
            background-color: #eee;
        }

        .form-signin {
            max-width: 330px;
            padding: 15px;
            margin: 0 auto;
        }

        .form-signin .form-signin-heading,
        .form-signin .checkbox {
            margin-bottom: 10px;
        }

        .form-signin .checkbox {
            font-weight: normal;
        }

        .form-signin .form-control {
            position: relative;
            height: auto;
            -webkit-box-sizing: border-box;
            -moz-box-sizing: border-box;
            box-sizing: border-box;
            padding: 10px;
            font-size: 16px;
        }

        .form-signin .form-control:focus {
            z-index: 2;
        }

        .form-signin input[type="email"] {
            margin-bottom: -1px;
            border-bottom-right-radius: 0;
            border-bottom-left-radius: 0;
        }

        .form-signin input[type="password"] {
            margin-bottom: 10px;
            border-top-left-radius: 0;
            border-top-right-radius: 0;
        }
    </style>
    <script src="/js/jquery-3.5.1.js"></script>
    <script>
        $(function () {
            $("#return-btn").click(function () {
                history.go(-1);
            });
        });
    </script>
</head>

<body>

<div class="container">
    <form class="form-signin" th:action="@{/authentication/form}" method="post">
        <h2 class="form-signin-heading">管理员登入</h2>
        <div class="alert alert-danger" role="alert" th:if="${error}">同户名或密码错误</div>
        <label for="inputUsername">用户名</label>
        <input type="text" name="username" id="inputUsername" class="form-control" placeholder="请输入用户名">
        <label for="inputPassword">密码</label>
        <input type="password" name="password" id="inputPassword" class="form-control" placeholder="请输入密码" required>
        <label class="col-md-6">
            <button id="return-btn" class="btn btn-lg btn-default btn-block" role="button">返回</button>
        </label>
        <label class="col-md-6">
            <button class="btn btn-lg btn-primary btn-block" type="submit">登入</button>
        </label>
    </form>
</div> <!-- /container -->
</body>
</html>
